<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
</head>
<body>
<div id="app">
<!--  1.绑定对象-->
    <div :style="{color:'deeppink',border:'1px solid black'}">绑定对象1</div>
    <div :style="obj">绑定对象2</div>
<!--    2.绑定数组-->
    <div :style="arr">绑定数组1</div>
    <div :style="[{textAlign:'center'},{backgroundColor:'#ccc',color:'red'}]">绑定数组2</div>
</div>
<script>
    Vue.config.productionTip = false
    const vm = new Vue({
        el: '#app',
        data() {
            return {
                obj:{
                    border:'2px solid red',
                    backgroundColor:'#ccc'
                },
                arr:[{backgroundColor:'#bfa'},{textAlign:'center'}]
            }
        }
    })
</script>
</body>
</html>